interface UserNameReq {
  userName?: string
}

interface UserNamesReq {
  userNames?: string
}

interface AlertGroupIdReq {
  alertgroupId: string
}

interface UserReq {
  email?: string
  tenantId?: string
  userName?: string
  userPassword?: string
  phone?: string
  queue?: string
  state?: number
  timeZone?: string
  avatar?: string
  name?: string
  newPassword?: string
  newPassword1?: string
  oldPassword?: string
  realName?: string
}

interface IdReq {
  id: number
}

interface IdStringReq {
  id: string | number
}

interface UserIdReq {
  userId: number
}

interface GrantDataSourceReq extends UserIdReq {
  datasourceIds: string
}

interface GrantResourceReq extends UserIdReq {
  resourceIds: string
}

interface GrantProject extends UserIdReq {
  projectIds: string
}

interface ProjectCodeReq {
  projectCode: string
}

interface GrantUDFReq {
  udfIds: string
}

interface GrantNamespaceReq {
  namespaceIds: string
}

interface ListAllReq extends UserReq {
  alertGroup?: string
  createTime?: string
  id?: number
  queueName?: string
  tenantCode?: string
  updateTime?: string
  userType?: 'ADMIN_USER' | 'GENERAL_USER'
}

interface ListReq {
  pageNo: number
  pageSize: number
  searchVal?: string
}

interface RegisterUserReq {
  email: string
  repeatPassword: string
  userName: string
  userPassword: string
}

interface UserInfoRes extends UserReq {
  id: string
  userType: string
  tenantCode?: any
  queueName?: any
  alertGroup?: any
  createTime: string
  updateTime: string
  securityConfigType: 'PASSWORD' | 'LDAP'

  name?: string
  realName?: string
  account?: string
  avatar?: string
}

interface UserListRes {
  id: number
  userName: string
  userPassword: string
  email: string
  phone: string
  userType: string
  tenantId: number
  state: number
  tenantCode?: any
  queueName?: any
  alertGroup?: any
  queue: string
  createTime: string
  updateTime: string
}

interface LoginInfoRes {
  account: string
  access_token: string
  tenant_id: string
  dept_id: string
  clients: Array<string>
  refresh_token: string
  role_name: string
  role_id: string
}

export type {
  UserNameReq,
  UserNamesReq,
  AlertGroupIdReq,
  UserReq,
  IdReq,
  IdStringReq,
  UserIdReq,
  GrantDataSourceReq,
  GrantResourceReq,
  GrantProject,
  ProjectCodeReq,
  GrantUDFReq,
  GrantNamespaceReq,
  ListAllReq,
  ListReq,
  RegisterUserReq,
  UserInfoRes,
  UserListRes,
  LoginInfoRes
}
